<template>
  <div class="app">
    <Eaditor v-model="state" />
  </div>
</template>

<script>
import data from './data.json'
import Eaditor from './packages/editor'
import { registerConfig as config } from './utils/editor-config'
import { provide, ref } from 'vue'
export default {
  components: {
    Eaditor
  },
  setup() {
    const state = ref(data)
    provide('config', config) // 将组件的配置直接传入

    return {
      state
    }
  }
}
</script>

<style lang="scss">
.app {
  position: fixed;
  top: 20px;
  bottom: 20px;
  left: 20px;
  right: 20px;
}
</style>
